package com.ihisomp.service.impl;

import com.ihisomp.dto.SysPathTreeDto;
import com.ihisomp.entity.OrgRolePage;
import com.ihisomp.mapper.OrgRolePageMapper;
import com.ihisomp.service.IOrgRolePageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色与页面关系 服务实现类
 * </p>
 *
 * @author zy
 * @since 2022-04-12
 */
@Service
public class OrgRolePageServiceImpl extends ServiceImpl<OrgRolePageMapper, OrgRolePage> implements IOrgRolePageService {

    /**
     * 根据角色代码删除角色对应程序
     *
     * @param roleKey
     * @return
     */
    @Override
    public int deleteByRoleKey(String roleKey) {
        return baseMapper.deleteByRoleKey(roleKey);
    }

    /**
     * 根据角色代码查询角色对应程序
     * @param roleKey
     * @return
     */
    @Override
    public List<SysPathTreeDto> getPageByRoleKey(String roleKey) {
        return baseMapper.getPageByRoleKey(roleKey);
    }
}
